package view.components.text 
{
	/**
	 * ...
	 * @author Alejandro
	 * 
			var style:Object = {
				x: 100,
				y: 400,
				backgroundColor: "AA0099",
				text:"hola",
				height: 100,
				size: 44
				};
			var text:CompleteText = new CompleteText(style);
		    addChild(text);
	 */
	
	import flash.text.TextFormat;
	import flash.text.TextFieldType;
	
	public class CompleteText extends AbstractEstructureText {
		
		public function CompleteText(propertysValues_V:Object){
			super(propertysValues_V);
			init();
		}
		
		private function init():void{
			configureFormat();
			configurePosition();
			selectable = false;
			this.text  = properties.text;
		}
			
		public function configurePosition():void{
			this.x      = properties.x;
			this.y      = properties.y;
			this.width  = properties.width;
			this.height = properties.height;
		}
		
		public function configureFormat():void {
			if (this.background = properties.background) {
				this.backgroundColor = properties.backgroundColor;
			}
			var format:TextFormat  = new TextFormat();
			format.size            = properties.size;
			format.font            = properties.font;
			format.color           = properties.color;
			format.align           = properties.align;
			trace(properties.align);
			format.underline       = properties.underline;
			this.defaultTextFormat = format;
		}
	}
}